from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
def main():
    driver = webdriver.Chrome()
    driver.get(r"D:\pythonanzhuang\xiangmu\UI自动化基础框架\test.html")
    # WebDriverWait(driver,30,0.2).until(lambda x:driver.find_element_by_id("username")).send_keys("xxx")
    locator = (By.ID,"username")
    print(locator)
    WebDriverWait(driver,30,0.2).until(EC.visibility_of_element_located(locator=locator)).send_keys("xxx")
# driver.close()

if __name__ == "__main__":
    main()

